home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 November / Freeware November 1998.img / dist / fw_elisp-manual-19.idb / usr / freeware / info / elisp-30.z / elisp-30 (.txt)
GNU Info File  |  1998-05-26  |  51KB  |  931 lines

  1. This is Info file elisp, produced by Makeinfo-1.63 from the input file
  2. elisp.texi.
  3.    This version is the edition 2.4.2 of the GNU Emacs Lisp Reference
  4. Manual.  It corresponds to Emacs Version 19.34.
  5.    Published by the Free Software Foundation 59 Temple Place, Suite 330
  6. Boston, MA  02111-1307  USA
  7.    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996 Free Software
  8. Foundation, Inc.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that the
  14. entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20.    Permission is granted to copy and distribute modified versions of
  21. this manual under the conditions for verbatim copying, provided also
  22. that the section entitled "GNU General Public License" is included
  23. exactly as in the original, and provided that the entire resulting
  24. derived work is distributed under the terms of a permission notice
  25. identical to this one.
  26.    Permission is granted to copy and distribute translations of this
  27. manual into another language, under the above conditions for modified
  28. versions, except that the section entitled "GNU General Public License"
  29. may be included in a translation approved by the Free Software
  30. Foundation instead of in the original English.
  31. File: elisp,  Node: Parsing Expressions,  Next: Standard Syntax Tables,  Prev: Motion and Syntax,  Up: Syntax Tables
  32. Parsing Balanced Expressions
  33. ============================
  34.    Here are several functions for parsing and scanning balanced
  35. expressions, also known as "sexps", in which parentheses match in
  36. pairs.  The syntax table controls the interpretation of characters, so
  37. these functions can be used for Lisp expressions when in Lisp mode and
  38. for C expressions when in C mode.  *Note List Motion::, for convenient
  39. higher-level functions for moving over balanced expressions.
  40.  - Function: parse-partial-sexp START LIMIT &optional TARGET-DEPTH
  41.           STOP-BEFORE STATE STOP-COMMENT
  42.      This function parses a sexp in the current buffer starting at
  43.      START, not scanning past LIMIT.  It stops at position LIMIT or
  44.      when certain criteria described below are met, and sets point to
  45.      the location where parsing stops.  It returns a value describing
  46.      the status of the parse at the point where it stops.
  47.      If STATE is `nil', START is assumed to be at the top level of
  48.      parenthesis structure, such as the beginning of a function
  49.      definition.  Alternatively, you might wish to resume parsing in the
  50.      middle of the structure.  To do this, you must provide a STATE
  51.      argument that describes the initial status of parsing.
  52.      If the third argument TARGET-DEPTH is non-`nil', parsing stops if
  53.      the depth in parentheses becomes equal to TARGET-DEPTH.  The depth
  54.      starts at 0, or at whatever is given in STATE.
  55.      If the fourth argument STOP-BEFORE is non-`nil', parsing stops
  56.      when it comes to any character that starts a sexp.  If
  57.      STOP-COMMENT is non-`nil', parsing stops when it comes to the
  58.      start of a comment.
  59.      The fifth argument STATE is an eight-element list of the same form
  60.      as the value of this function, described below.  The return value
  61.      of one call may be used to initialize the state of the parse on
  62.      another call to `parse-partial-sexp'.
  63.      The result is a list of eight elements describing the final state
  64.      of the parse:
  65.        0. The depth in parentheses, counting from 0.
  66.        1. The character position of the start of the innermost
  67.           parenthetical grouping containing the stopping point; `nil'
  68.           if none.
  69.        2. The character position of the start of the last complete
  70.           subexpression terminated; `nil' if none.
  71.        3. Non-`nil' if inside a string.  More precisely, this is the
  72.           character that will terminate the string.
  73.        4. `t' if inside a comment (of either style).
  74.        5. `t' if point is just after a quote character.
  75.        6. The minimum parenthesis depth encountered during this scan.
  76.        7. `t' if inside a comment of style "b".
  77.      Elements 0, 3, 4, 5 and 7 are significant in the argument STATE.
  78.      This function is most often used to compute indentation for
  79.      languages that have nested parentheses.
  80.  - Function: scan-lists FROM COUNT DEPTH
  81.      This function scans forward COUNT balanced parenthetical groupings
  82.      from character number FROM.  It returns the character position
  83.      where the scan stops.
  84.      If DEPTH is nonzero, parenthesis depth counting begins from that
  85.      value.  The only candidates for stopping are places where the
  86.      depth in parentheses becomes zero; `scan-lists' counts COUNT such
  87.      places and then stops.  Thus, a positive value for DEPTH means go
  88.      out DEPTH levels of parenthesis.
  89.      Scanning ignores comments if `parse-sexp-ignore-comments' is
  90.      non-`nil'.
  91.      If the scan reaches the beginning or end of the buffer (or its
  92.      accessible portion), and the depth is not zero, an error is
  93.      signaled.  If the depth is zero but the count is not used up,
  94.      `nil' is returned.
  95.  - Function: scan-sexps FROM COUNT
  96.      This function scans forward COUNT sexps from character position
  97.      FROM.  It returns the character position where the scan stops.
  98.      Scanning ignores comments if `parse-sexp-ignore-comments' is
  99.      non-`nil'.
  100.      If the scan reaches the beginning or end of (the accessible part
  101.      of) the buffer in the middle of a parenthetical grouping, an error
  102.      is signaled.  If it reaches the beginning or end between groupings
  103.      but before count is used up, `nil' is returned.
  104.  - Variable: parse-sexp-ignore-comments
  105.      If the value is non-`nil', then comments are treated as whitespace
  106.      by the functions in this section and by `forward-sexp'.
  107.      In older Emacs versions, this feature worked only when the comment
  108.      terminator is something like `*/', and appears only to end a
  109.      comment.  In languages where newlines terminate comments, it was
  110.      necessary make this variable `nil', since not every newline is the
  111.      end of a comment.  This limitation no longer exists.
  112.    You can use `forward-comment' to move forward or backward over one
  113. comment or several comments.
  114.  - Function: forward-comment COUNT
  115.      This function moves point forward across COUNT comments (backward,
  116.      if COUNT is negative).  If it finds anything other than a comment
  117.      or whitespace, it stops, leaving point at the place where it
  118.      stopped.  It also stops after satisfying COUNT.
  119.    To move forward over all comments and whitespace following point, use
  120. `(forward-comment (buffer-size))'.  `(buffer-size)' is a good argument
  121. to use, because the number of comments in the buffer cannot exceed that
  122. many.
  123. File: elisp,  Node: Standard Syntax Tables,  Next: Syntax Table Internals,  Prev: Parsing Expressions,  Up: Syntax Tables
  124. Some Standard Syntax Tables
  125. ===========================
  126.    Most of the major modes in Emacs have their own syntax tables.  Here
  127. are several of them:
  128.  - Function: standard-syntax-table
  129.      This function returns the standard syntax table, which is the
  130.      syntax table used in Fundamental mode.
  131.  - Variable: text-mode-syntax-table
  132.      The value of this variable is the syntax table used in Text mode.
  133.  - Variable: c-mode-syntax-table
  134.      The value of this variable is the syntax table for C-mode buffers.
  135.  - Variable: emacs-lisp-mode-syntax-table
  136.      The value of this variable is the syntax table used in Emacs Lisp
  137.      mode by editing commands.  (It has no effect on the Lisp `read'
  138.      function.)
  139. File: elisp,  Node: Syntax Table Internals,  Prev: Standard Syntax Tables,  Up: Syntax Tables
  140. Syntax Table Internals
  141. ======================
  142.    Each element of a syntax table is an integer that encodes the syntax
  143. of one character: the syntax class, possible matching character, and
  144. flags.  Lisp programs don't usually work with the elements directly; the
  145. Lisp-level syntax table functions usually work with syntax descriptors
  146. (*note Syntax Descriptors::.).
  147.    The low 8 bits of each element of a syntax table indicate the syntax
  148. class.
  149. Integer
  150.      Class
  151.      whitespace
  152.      punctuation
  153.      word
  154.      symbol
  155.      open parenthesis
  156.      close parenthesis
  157.      expression prefix
  158.      string quote
  159.      paired delimiter
  160.      escape
  161.      character quote
  162.      comment-start
  163.      comment-end
  164.      inherit
  165.    The next 8 bits are the matching opposite parenthesis (if the
  166. character has parenthesis syntax); otherwise, they are not meaningful.
  167. The next 6 bits are the flags.
  168. File: elisp,  Node: Abbrevs,  Next: Processes,  Prev: Syntax Tables,  Up: Top
  169. Abbrevs And Abbrev Expansion
  170. ****************************
  171.    An abbreviation or "abbrev" is a string of characters that may be
  172. expanded to a longer string.  The user can insert the abbrev string and
  173. find it replaced automatically with the expansion of the abbrev.  This
  174. saves typing.
  175.    The set of abbrevs currently in effect is recorded in an "abbrev
  176. table".  Each buffer has a local abbrev table, but normally all buffers
  177. in the same major mode share one abbrev table.  There is also a global
  178. abbrev table.  Normally both are used.
  179.    An abbrev table is represented as an obarray containing a symbol for
  180. each abbreviation.  The symbol's name is the abbreviation; its value is
  181. the expansion; its function definition is the hook function to do the
  182. expansion (*note Defining Abbrevs::.); its property list cell contains
  183. the use count, the number of times the abbreviation has been expanded.
  184. Because these symbols are not interned in the usual obarray, they will
  185. never appear as the result of reading a Lisp expression; in fact,
  186. normally they are never used except by the code that handles abbrevs.
  187. Therefore, it is safe to use them in an extremely nonstandard way.
  188. *Note Creating Symbols::.
  189.    For the user-level commands for abbrevs, see *Note Abbrev Mode:
  190. (emacs)Abbrevs.
  191. * Menu:
  192. * Abbrev Mode::                 Setting up Emacs for abbreviation.
  193. * Tables: Abbrev Tables.        Creating and working with abbrev tables.
  194. * Defining Abbrevs::            Specifying abbreviations and their expansions.
  195. * Files: Abbrev Files.          Saving abbrevs in files.
  196. * Expansion: Abbrev Expansion.  Controlling expansion; expansion subroutines.
  197. * Standard Abbrev Tables::      Abbrev tables used by various major modes.
  198. File: elisp,  Node: Abbrev Mode,  Next: Abbrev Tables,  Prev: Abbrevs,  Up: Abbrevs
  199. Setting Up Abbrev Mode
  200. ======================
  201.    Abbrev mode is a minor mode controlled by the value of the variable
  202. `abbrev-mode'.
  203.  - Variable: abbrev-mode
  204.      A non-`nil' value of this variable turns on the automatic expansion
  205.      of abbrevs when their abbreviations are inserted into a buffer.
  206.      If the value is `nil', abbrevs may be defined, but they are not
  207.      expanded automatically.
  208.      This variable automatically becomes local when set in any fashion.
  209.  - Variable: default-abbrev-mode
  210.      This is the value of `abbrev-mode' for buffers that do not
  211.      override it.  This is the same as `(default-value 'abbrev-mode)'.
  212. File: elisp,  Node: Abbrev Tables,  Next: Defining Abbrevs,  Prev: Abbrev Mode,  Up: Abbrevs
  213. Abbrev Tables
  214. =============
  215.    This section describes how to create and manipulate abbrev tables.
  216.  - Function: make-abbrev-table
  217.      This function creates and returns a new, empty abbrev table--an
  218.      obarray containing no symbols.  It is a vector filled with zeros.
  219.  - Function: clear-abbrev-table TABLE
  220.      This function undefines all the abbrevs in abbrev table TABLE,
  221.      leaving it empty.  The function returns `nil'.
  222.  - Function: define-abbrev-table TABNAME DEFINITIONS
  223.      This function defines TABNAME (a symbol) as an abbrev table name,
  224.      i.e., as a variable whose value is an abbrev table.  It defines
  225.      abbrevs in the table according to DEFINITIONS, a list of elements
  226.      of the form `(ABBREVNAME EXPANSION HOOK USECOUNT)'.  The value is
  227.      always `nil'.
  228.  - Variable: abbrev-table-name-list
  229.      This is a list of symbols whose values are abbrev tables.
  230.      `define-abbrev-table' adds the new abbrev table name to this list.
  231.  - Function: insert-abbrev-table-description NAME &optional HUMAN
  232.      This function inserts before point a description of the abbrev
  233.      table named NAME.  The argument NAME is a symbol whose value is an
  234.      abbrev table.  The value is always `nil'.
  235.      If HUMAN is non-`nil', the description is human-oriented.
  236.      Otherwise the description is a Lisp expression--a call to
  237.      `define-abbrev-table' that would define NAME exactly as it is
  238.      currently defined.
  239. File: elisp,  Node: Defining Abbrevs,  Next: Abbrev Files,  Prev: Abbrev Tables,  Up: Abbrevs
  240. Defining Abbrevs
  241. ================
  242.    These functions define an abbrev in a specified abbrev table.
  243. `define-abbrev' is the low-level basic function, while `add-abbrev' is
  244. used by commands that ask for information from the user.
  245.  - Function: add-abbrev TABLE TYPE ARG
  246.      This function adds an abbreviation to abbrev table TABLE based on
  247.      information from the user.  The argument TYPE is a string
  248.      describing in English the kind of abbrev this will be (typically,
  249.      `"global"' or `"mode-specific"'); this is used in prompting the
  250.      user.  The argument ARG is the number of words in the expansion.
  251.      The return value is the symbol that internally represents the new
  252.      abbrev, or `nil' if the user declines to confirm redefining an
  253.      existing abbrev.
  254.  - Function: define-abbrev TABLE NAME EXPANSION HOOK
  255.      This function defines an abbrev in TABLE named NAME, to expand to
  256.      EXPANSION, and call HOOK.  The return value is an uninterned
  257.      symbol that represents the abbrev inside Emacs; its name is NAME.
  258.      The argument NAME should be a string.  The argument EXPANSION
  259.      should be a string, or `nil' to undefine the abbrev.
  260.      The argument HOOK is a function or `nil'.  If HOOK is non-`nil',
  261.      then it is called with no arguments after the abbrev is replaced
  262.      with EXPANSION; point is located at the end of EXPANSION when HOOK
  263.      is called.
  264.      The use count of the abbrev is initialized to zero.
  265.  - User Option: only-global-abbrevs
  266.      If this variable is non-`nil', it means that the user plans to use
  267.      global abbrevs only.  This tells the commands that define
  268.      mode-specific abbrevs to define global ones instead.  This
  269.      variable does not alter the behavior of the functions in this
  270.      section; it is examined by their callers.
  271. File: elisp,  Node: Abbrev Files,  Next: Abbrev Expansion,  Prev: Defining Abbrevs,  Up: Abbrevs
  272. Saving Abbrevs in Files
  273. =======================
  274.    A file of saved abbrev definitions is actually a file of Lisp code.
  275. The abbrevs are saved in the form of a Lisp program to define the same
  276. abbrev tables with the same contents.  Therefore, you can load the file
  277. with `load' (*note How Programs Do Loading::.).  However, the function
  278. `quietly-read-abbrev-file' is provided as a more convenient interface.
  279.    User-level facilities such as `save-some-buffers' can save abbrevs
  280. in a file automatically, under the control of variables described here.
  281.  - User Option: abbrev-file-name
  282.      This is the default file name for reading and saving abbrevs.
  283.  - Function: quietly-read-abbrev-file FILENAME
  284.      This function reads abbrev definitions from a file named FILENAME,
  285.      previously written with `write-abbrev-file'.  If FILENAME is
  286.      `nil', the file specified in `abbrev-file-name' is used.
  287.      `save-abbrevs' is set to `t' so that changes will be saved.
  288.      This function does not display any messages.  It returns `nil'.
  289.  - User Option: save-abbrevs
  290.      A non-`nil' value for `save-abbrev' means that Emacs should save
  291.      abbrevs when files are saved.  `abbrev-file-name' specifies the
  292.      file to save the abbrevs in.
  293.  - Variable: abbrevs-changed
  294.      This variable is set non-`nil' by defining or altering any
  295.      abbrevs.  This serves as a flag for various Emacs commands to
  296.      offer to save your abbrevs.
  297.  - Command: write-abbrev-file FILENAME
  298.      Save all abbrev definitions, in all abbrev tables, in the file
  299.      FILENAME, in the form of a Lisp program that when loaded will
  300.      define the same abbrevs.  This function returns `nil'.
  301. File: elisp,  Node: Abbrev Expansion,  Next: Standard Abbrev Tables,  Prev: Abbrev Files,  Up: Abbrevs
  302. Looking Up and Expanding Abbreviations
  303. ======================================
  304.    Abbrevs are usually expanded by commands for interactive use,
  305. including `self-insert-command'.  This section describes the
  306. subroutines used in writing such functions, as well as the variables
  307. they use for communication.
  308.  - Function: abbrev-symbol ABBREV &optional TABLE
  309.      This function returns the symbol representing the abbrev named
  310.      ABBREV.  The value returned is `nil' if that abbrev is not
  311.      defined.  The optional second argument TABLE is the abbrev table
  312.      to look it up in.  If TABLE is `nil', this function tries first
  313.      the current buffer's local abbrev table, and second the global
  314.      abbrev table.
  315.  - Function: abbrev-expansion ABBREV &optional TABLE
  316.      This function returns the string that ABBREV would expand into (as
  317.      defined by the abbrev tables used for the current buffer).  The
  318.      optional argument TABLE specifies the abbrev table to use, as in
  319.      `abbrev-symbol'.
  320.  - Command: expand-abbrev
  321.      This command expands the abbrev before point, if any.  If point
  322.      does not follow an abbrev, this command does nothing.  The command
  323.      returns `t' if it did expansion, `nil' otherwise.
  324.  - Command: abbrev-prefix-mark &optional ARG
  325.      Mark current point as the beginning of an abbrev.  The next call to
  326.      `expand-abbrev' will use the text from here to point (where it is
  327.      then) as the abbrev to expand, rather than using the previous word
  328.      as usual.
  329.  - User Option: abbrev-all-caps
  330.      When this is set non-`nil', an abbrev entered entirely in upper
  331.      case is expanded using all upper case.  Otherwise, an abbrev
  332.      entered entirely in upper case is expanded by capitalizing each
  333.      word of the expansion.
  334.  - Variable: abbrev-start-location
  335.      This is the buffer position for `expand-abbrev' to use as the start
  336.      of the next abbrev to be expanded.  (`nil' means use the word
  337.      before point instead.)  `abbrev-start-location' is set to `nil'
  338.      each time `expand-abbrev' is called.  This variable is also set by
  339.      `abbrev-prefix-mark'.
  340.  - Variable: abbrev-start-location-buffer
  341.      The value of this variable is the buffer for which
  342.      `abbrev-start-location' has been set.  Trying to expand an abbrev
  343.      in any other buffer clears `abbrev-start-location'.  This variable
  344.      is set by `abbrev-prefix-mark'.
  345.  - Variable: last-abbrev
  346.      This is the `abbrev-symbol' of the last abbrev expanded.  This
  347.      information is left by `expand-abbrev' for the sake of the
  348.      `unexpand-abbrev' command.
  349.  - Variable: last-abbrev-location
  350.      This is the location of the last abbrev expanded.  This contains
  351.      information left by `expand-abbrev' for the sake of the
  352.      `unexpand-abbrev' command.
  353.  - Variable: last-abbrev-text
  354.      This is the exact expansion text of the last abbrev expanded,
  355.      after case conversion (if any).  Its value is `nil' if the abbrev
  356.      has already been unexpanded.  This contains information left by
  357.      `expand-abbrev' for the sake of the `unexpand-abbrev' command.
  358.  - Variable: pre-abbrev-expand-hook
  359.      This is a normal hook whose functions are executed, in sequence,
  360.      just before any expansion of an abbrev.  *Note Hooks::.  Since it
  361.      is a normal hook, the hook functions receive no arguments.
  362.      However, they can find the abbrev to be expanded by looking in the
  363.      buffer before point.
  364.    The following sample code shows a simple use of
  365. `pre-abbrev-expand-hook'.  If the user terminates an abbrev with a
  366. punctuation character, the hook function asks for confirmation.  Thus,
  367. this hook allows the user to decide whether to expand the abbrev, and
  368. aborts expansion if it is not confirmed.
  369.      (add-hook 'pre-abbrev-expand-hook 'query-if-not-space)
  370.      
  371.      ;; This is the function invoked by `pre-abbrev-expand-hook'.
  372.      
  373.      ;; If the user terminated the abbrev with a space, the function does
  374.      ;; nothing (that is, it returns so that the abbrev can expand).  If the
  375.      ;; user entered some other character, this function asks whether
  376.      ;; expansion should continue.
  377.      
  378.      ;; If the user answers the prompt with `y', the function returns
  379.      ;; `nil' (because of the `not' function), but that is
  380.      ;; acceptable; the return value has no effect on expansion.
  381.      
  382.      (defun query-if-not-space ()
  383.        (if (/= ?\  (preceding-char))
  384.            (if (not (y-or-n-p "Do you want to expand this abbrev? "))
  385.                (error "Not expanding this abbrev"))))
  386. File: elisp,  Node: Standard Abbrev Tables,  Prev: Abbrev Expansion,  Up: Abbrevs
  387. Standard Abbrev Tables
  388. ======================
  389.    Here we list the variables that hold the abbrev tables for the
  390. preloaded major modes of Emacs.
  391.  - Variable: global-abbrev-table
  392.      This is the abbrev table for mode-independent abbrevs.  The abbrevs
  393.      defined in it apply to all buffers.  Each buffer may also have a
  394.      local abbrev table, whose abbrev definitions take precedence over
  395.      those in the global table.
  396.  - Variable: local-abbrev-table
  397.      The value of this buffer-local variable is the (mode-specific)
  398.      abbreviation table of the current buffer.
  399.  - Variable: fundamental-mode-abbrev-table
  400.      This is the local abbrev table used in Fundamental mode; in other
  401.      words, it is the local abbrev table in all buffers in Fundamental
  402.      mode.
  403.  - Variable: text-mode-abbrev-table
  404.      This is the local abbrev table used in Text mode.
  405.  - Variable: c-mode-abbrev-table
  406.      This is the local abbrev table used in C mode.
  407.  - Variable: lisp-mode-abbrev-table
  408.      This is the local abbrev table used in Lisp mode and Emacs Lisp
  409.      mode.
  410. File: elisp,  Node: Processes,  Next: System Interface,  Prev: Abbrevs,  Up: Top
  411. Processes
  412. *********
  413.    In the terminology of operating systems, a "process" is a space in
  414. which a program can execute.  Emacs runs in a process.  Emacs Lisp
  415. programs can invoke other programs in processes of their own.  These are
  416. called "subprocesses" or "child processes" of the Emacs process, which
  417. is their "parent process".
  418.    A subprocess of Emacs may be "synchronous" or "asynchronous",
  419. depending on how it is created.  When you create a synchronous
  420. subprocess, the Lisp program waits for the subprocess to terminate
  421. before continuing execution.  When you create an asynchronous
  422. subprocess, it can run in parallel with the Lisp program.  This kind of
  423. subprocess is represented within Emacs by a Lisp object which is also
  424. called a "process".  Lisp programs can use this object to communicate
  425. with the subprocess or to control it.  For example, you can send
  426. signals, obtain status information, receive output from the process, or
  427. send input to it.
  428.  - Function: processp OBJECT
  429.      This function returns `t' if OBJECT is a process, `nil' otherwise.
  430. * Menu:
  431. * Subprocess Creation::      Functions that start subprocesses.
  432. * Synchronous Processes::    Details of using synchronous subprocesses.
  433. * MS-DOS Subprocesses::      On MS-DOS, you must indicate text vs binary
  434.                                 for data sent to and from a subprocess.
  435. * Asynchronous Processes::   Starting up an asynchronous subprocess.
  436. * Deleting Processes::       Eliminating an asynchronous subprocess.
  437. * Process Information::      Accessing run-status and other attributes.
  438. * Input to Processes::       Sending input to an asynchronous subprocess.
  439. * Signals to Processes::     Stopping, continuing or interrupting
  440.                                an asynchronous subprocess.
  441. * Output from Processes::    Collecting output from an asynchronous subprocess.
  442. * Sentinels::                Sentinels run when process run-status changes.
  443. * Transaction Queues::         Transaction-based communication with subprocesses.
  444. * Network::                  Opening network connections.
  445. File: elisp,  Node: Subprocess Creation,  Next: Synchronous Processes,  Up: Processes
  446. Functions that Create Subprocesses
  447. ==================================
  448.    There are three functions that create a new subprocess in which to
  449. run a program.  One of them, `start-process', creates an asynchronous
  450. process and returns a process object (*note Asynchronous Processes::.).
  451. The other two, `call-process' and `call-process-region', create a
  452. synchronous process and do not return a process object (*note
  453. Synchronous Processes::.).
  454.    Synchronous and asynchronous processes are explained in following
  455. sections.  Since the three functions are all called in a similar
  456. fashion, their common arguments are described here.
  457.    In all cases, the function's PROGRAM argument specifies the program
  458. to be run.  An error is signaled if the file is not found or cannot be
  459. executed.  If the file name is relative, the variable `exec-path'
  460. contains a list of directories to search.  Emacs initializes
  461. `exec-path' when it starts up, based on the value of the environment
  462. variable `PATH'.  The standard file name constructs, `~', `.', and
  463. `..', are interpreted as usual in `exec-path', but environment variable
  464. substitutions (`$HOME', etc.) are not recognized; use
  465. `substitute-in-file-name' to perform them (*note File Name
  466. Expansion::.).
  467.    Each of the subprocess-creating functions has a BUFFER-OR-NAME
  468. argument which specifies where the standard output from the program will
  469. go.  If BUFFER-OR-NAME is `nil', that says to discard the output unless
  470. a filter function handles it.  (*Note Filter Functions::, and *Note
  471. Read and Print::.)  Normally, you should avoid having multiple
  472. processes send output to the same buffer because their output would be
  473. intermixed randomly.
  474.    All three of the subprocess-creating functions have a `&rest'
  475. argument, ARGS.  The ARGS must all be strings, and they are supplied to
  476. PROGRAM as separate command line arguments.  Wildcard characters and
  477. other shell constructs are not allowed in these strings, since they are
  478. passed directly to the specified program.
  479.    *Please note:* The argument PROGRAM contains only the name of the
  480. program; it may not contain any command-line arguments.  You must use
  481. ARGS to provide those.
  482.    The subprocess gets its current directory from the value of
  483. `default-directory' (*note File Name Expansion::.).
  484.    The subprocess inherits its environment from Emacs; but you can
  485. specify overrides for it with `process-environment'.  *Note System
  486. Environment::.
  487.  - Variable: exec-directory
  488.      The value of this variable is the name of a directory (a string)
  489.      that contains programs that come with GNU Emacs, that are intended
  490.      for Emacs to invoke.  The program `wakeup' is an example of such a
  491.      program; the `display-time' command uses it to get a reminder once
  492.      per minute.
  493.  - User Option: exec-path
  494.      The value of this variable is a list of directories to search for
  495.      programs to run in subprocesses.  Each element is either the name
  496.      of a directory (i.e., a string), or `nil', which stands for the
  497.      default directory (which is the value of `default-directory').
  498.      The value of `exec-path' is used by `call-process' and
  499.      `start-process' when the PROGRAM argument is not an absolute file
  500.      name.
  501. File: elisp,  Node: Synchronous Processes,  Next: MS-DOS Subprocesses,  Prev: Subprocess Creation,  Up: Processes
  502. Creating a Synchronous Process
  503. ==============================
  504.    After a "synchronous process" is created, Emacs waits for the
  505. process to terminate before continuing.  Starting Dired is an example of
  506. this: it runs `ls' in a synchronous process, then modifies the output
  507. slightly.  Because the process is synchronous, the entire directory
  508. listing arrives in the buffer before Emacs tries to do anything with it.
  509.    While Emacs waits for the synchronous subprocess to terminate, the
  510. user can quit by typing `C-g'.  The first `C-g' tries to kill the
  511. subprocess with a `SIGINT' signal; but it waits until the subprocess
  512. actually terminates before quitting.  If during that time the user
  513. types another `C-g', that kills the subprocess instantly with `SIGKILL'
  514. and quits immediately.  *Note Quitting::.
  515.    The synchronous subprocess functions returned `nil' in version 18.
  516. In version 19, they return an indication of how the process terminated.
  517.  - Function: call-process PROGRAM &optional INFILE DESTINATION DISPLAY
  518.           &rest ARGS
  519.      This function calls PROGRAM in a separate process and waits for it
  520.      to finish.
  521.      The standard input for the process comes from file INFILE if
  522.      INFILE is not `nil' and from `/dev/null' otherwise.  The argument
  523.      DESTINATION says where to put the process output.  Here are the
  524.      possibilities:
  525.     a buffer
  526.           Insert the output in that buffer, before point.  This
  527.           includes both the standard output stream and the standard
  528.           error stream of the process.
  529.     a string
  530.           Find the buffer with that name, then insert the output in
  531.           that buffer, before point.
  532.     `t'
  533.           Insert the output in the current buffer, before point.
  534.     `nil'
  535.           Discard the output.
  536.     0
  537.           Discard the output, and return immediately without waiting
  538.           for the subprocess to finish.
  539.           In this case, the process is not truly synchronous, since it
  540.           can run in parallel with Emacs; but you can think of it as
  541.           synchronous in that Emacs is essentially finished with the
  542.           subprocess as soon as this function returns.
  543.     (REAL-DESTINATION ERROR-DESTINATION)
  544.           Keep the standard output stream separate from the standard
  545.           error stream; deal with the ordinary output as specified by
  546.           REAL-DESTINATION, and dispose of the error output according
  547.           to ERROR-DESTINATION.  The value `nil' means discard it, `t'
  548.           means mix it with the ordinary output, and a string specifies
  549.           a file name to redirect error output into.
  550.           You can't directly specify a buffer to put the error output
  551.           in; that is too difficult to implement.  But you can achieve
  552.           this result by sending the error output to a temporary file
  553.           and then inserting the file into a buffer.
  554.      If DISPLAY is non-`nil', then `call-process' redisplays the buffer
  555.      as output is inserted.  Otherwise the function does no redisplay,
  556.      and the results become visible on the screen only when Emacs
  557.      redisplays that buffer in the normal course of events.
  558.      The remaining arguments, ARGS, are strings that specify command
  559.      line arguments for the program.
  560.      The value returned by `call-process' (unless you told it not to
  561.      wait) indicates the reason for process termination.  A number
  562.      gives the exit status of the subprocess; 0 means success, and any
  563.      other value means failure.  If the process terminated with a
  564.      signal, `call-process' returns a string describing the signal.
  565.      In the examples below, the buffer `foo' is current.
  566.           (call-process "pwd" nil t)
  567.                => nil
  568.           
  569.           ---------- Buffer: foo ----------
  570.           /usr/user/lewis/manual
  571.           ---------- Buffer: foo ----------
  572.           (call-process "grep" nil "bar" nil "lewis" "/etc/passwd")
  573.                => nil
  574.           
  575.           ---------- Buffer: bar ----------
  576.           lewis:5LTsHm66CSWKg:398:21:Bil Lewis:/user/lewis:/bin/csh
  577.           
  578.           ---------- Buffer: bar ----------
  579.      The `insert-directory' function contains a good example of the use
  580.      of `call-process':
  581.           (call-process insert-directory-program nil t nil switches
  582.                         (if full-directory-p
  583.                             (concat (file-name-as-directory file) ".")
  584.                           file))
  585.  - Function: call-process-region START END PROGRAM &optional DELETE
  586.           DESTINATION DISPLAY &rest ARGS
  587.      This function sends the text between START to END as standard
  588.      input to a process running PROGRAM.  It deletes the text sent if
  589.      DELETE is non-`nil'; this is useful when BUFFER is `t', to insert
  590.      the output in the current buffer.
  591.      The arguments DESTINATION and DISPLAY control what to do with the
  592.      output from the subprocess, and whether to update the display as
  593.      it comes in.  For details, see the description of `call-process',
  594.      above.  If DESTINATION is the integer 0, `call-process-region'
  595.      discards the output and returns `nil' immediately, without waiting
  596.      for the subprocess to finish.
  597.      The remaining arguments, ARGS, are strings that specify command
  598.      line arguments for the program.
  599.      The return value of `call-process-region' is just like that of
  600.      `call-process': `nil' if you told it to return without waiting;
  601.      otherwise, a number or string which indicates how the subprocess
  602.      terminated.
  603.      In the following example, we use `call-process-region' to run the
  604.      `cat' utility, with standard input being the first five characters
  605.      in buffer `foo' (the word `input').  `cat' copies its standard
  606.      input into its standard output.  Since the argument DESTINATION is
  607.      `t', this output is inserted in the current buffer.
  608.           ---------- Buffer: foo ----------
  609.           input-!-
  610.           ---------- Buffer: foo ----------
  611.           (call-process-region 1 6 "cat" nil t)
  612.                => nil
  613.           
  614.           ---------- Buffer: foo ----------
  615.           inputinput-!-
  616.           ---------- Buffer: foo ----------
  617.      The `shell-command-on-region' command uses `call-process-region'
  618.      like this:
  619.           (call-process-region
  620.            start end
  621.            shell-file-name      ; Name of program.
  622.            nil                  ; Do not delete region.
  623.            buffer               ; Send output to `buffer'.
  624.            nil                  ; No redisplay during output.
  625.            "-c" command)        ; Arguments for the shell.
  626. File: elisp,  Node: MS-DOS Subprocesses,  Next: Asynchronous Processes,  Prev: Synchronous Processes,  Up: Processes
  627. MS-DOS Subprocesses
  628. ===================
  629.    On MS-DOS, you must indicate whether the data going to and from a
  630. synchronous subprocess are text or binary.  Text data requires
  631. translation between the end-of-line convention used within Emacs (a
  632. single newline character) and the convention used outside Emacs (the
  633. two-character sequence, CRLF).
  634.    The variable `binary-process-input' applies to input sent to the
  635. subprocess, and `binary-process-output' applies to output received from
  636. it.  A non-`nil' value means the data is non-text; `nil' means the data
  637. is text, and calls for conversion.
  638.  - Variable: binary-process-input
  639.      If this variable is `nil', convert newlines to CRLF sequences in
  640.      the input to a synchronous subprocess.
  641.  - Variable: binary-process-output
  642.      If this variable is `nil', convert CRLF sequences to newlines in
  643.      the output from a synchronous subprocess.
  644.    *Note Files and MS-DOS::, for related information.
  645. File: elisp,  Node: Asynchronous Processes,  Next: Deleting Processes,  Prev: MS-DOS Subprocesses,  Up: Processes
  646. Creating an Asynchronous Process
  647. ================================
  648.    After an "asynchronous process" is created, Emacs and the Lisp
  649. program both continue running immediately.  The process may thereafter
  650. run in parallel with Emacs, and the two may communicate with each other
  651. using the functions described in following sections.  Here we describe
  652. how to create an asynchronous process with `start-process'.
  653.  - Function: start-process NAME BUFFER-OR-NAME PROGRAM &rest ARGS
  654.      This function creates a new asynchronous subprocess and starts the
  655.      program PROGRAM running in it.  It returns a process object that
  656.      stands for the new subprocess in Lisp.  The argument NAME
  657.      specifies the name for the process object; if a process with this
  658.      name already exists, then NAME is modified (by adding `<1>', etc.)
  659.      to be unique.  The buffer BUFFER-OR-NAME is the buffer to
  660.      associate with the process.
  661.      The remaining arguments, ARGS, are strings that specify command
  662.      line arguments for the program.
  663.      In the example below, the first process is started and runs
  664.      (rather, sleeps) for 100 seconds.  Meanwhile, the second process
  665.      is started, and given the name `my-process<1>' for the sake of
  666.      uniqueness.  It inserts the directory listing at the end of the
  667.      buffer `foo', before the first process finishes.  Then it
  668.      finishes, and a message to that effect is inserted in the buffer.
  669.      Much later, the first process finishes, and another message is
  670.      inserted in the buffer for it.
  671.           (start-process "my-process" "foo" "sleep" "100")
  672.                => #<process my-process>
  673.           (start-process "my-process" "foo" "ls" "-l" "/user/lewis/bin")
  674.                => #<process my-process<1>>
  675.           
  676.           ---------- Buffer: foo ----------
  677.           total 2
  678.           lrwxrwxrwx  1 lewis     14 Jul 22 10:12 gnuemacs --> /emacs
  679.           -rwxrwxrwx  1 lewis     19 Jul 30 21:02 lemon
  680.           
  681.           Process my-process<1> finished
  682.           
  683.           Process my-process finished
  684.           ---------- Buffer: foo ----------
  685.  - Function: start-process-shell-command NAME BUFFER-OR-NAME COMMAND
  686.           &rest COMMAND-ARGS
  687.      This function is like `start-process' except that it uses a shell
  688.      to execute the specified command.  The argument COMMAND is a shell
  689.      command name, and COMMAND-ARGS are the arguments for the shell
  690.      command.
  691.  - Variable: process-connection-type
  692.      This variable controls the type of device used to communicate with
  693.      asynchronous subprocesses.  If it is non-`nil', then PTYs are
  694.      used, when available.  Otherwise, pipes are used.
  695.      PTYs are usually preferable for processes visible to the user, as
  696.      in Shell mode, because they allow job control (`C-c', `C-z', etc.)
  697.      to work between the process and its children whereas pipes do not.
  698.      For subprocesses used for internal purposes by programs, it is
  699.      often better to use a pipe, because they are more efficient.  In
  700.      addition, the total number of PTYs is limited on many systems and
  701.      it is good not to waste them.
  702.      The value `process-connection-type' is used when `start-process'
  703.      is called.  So you can specify how to communicate with one
  704.      subprocess by binding the variable around the call to
  705.      `start-process'.
  706.           (let ((process-connection-type nil))  ; Use a pipe.
  707.             (start-process ...))
  708.      To determine whether a given subprocess actually got a pipe or a
  709.      PTY, use the function `process-tty-name' (*note Process
  710.      Information::.).
  711. File: elisp,  Node: Deleting Processes,  Next: Process Information,  Prev: Asynchronous Processes,  Up: Processes
  712. Deleting Processes
  713. ==================
  714.    "Deleting a process" disconnects Emacs immediately from the
  715. subprocess, and removes it from the list of active processes.  It sends
  716. a signal to the subprocess to make the subprocess terminate, but this is
  717. not guaranteed to happen immediately.  The process object itself
  718. continues to exist as long as other Lisp objects point to it.  The
  719. process mark continues to point to the same place as before (usually
  720. into a buffer where output from the process was being inserted).
  721.    You can delete a process explicitly at any time.  Processes are
  722. deleted automatically after they terminate, but not necessarily right
  723. away.  If you delete a terminated process explicitly before it is
  724. deleted automatically, no harm results.
  725.  - Variable: delete-exited-processes
  726.      This variable controls automatic deletion of processes that have
  727.      terminated (due to calling `exit' or to a signal).  If it is
  728.      `nil', then they continue to exist until the user runs
  729.      `list-processes'.  Otherwise, they are deleted immediately after
  730.      they exit.
  731.  - Function: delete-process NAME
  732.      This function deletes the process associated with NAME, killing it
  733.      with a `SIGHUP' signal.  The argument NAME may be a process, the
  734.      name of a process, a buffer, or the name of a buffer.
  735.           (delete-process "*shell*")
  736.                => nil
  737.  - Function: process-kill-without-query PROCESS
  738.      This function declares that Emacs need not query the user if
  739.      PROCESS is still running when Emacs is exited.  The process will
  740.      be deleted silently.  The value is `t'.
  741.           (process-kill-without-query (get-process "shell"))
  742.                => t
  743. File: elisp,  Node: Process Information,  Next: Input to Processes,  Prev: Deleting Processes,  Up: Processes
  744. Process Information
  745. ===================
  746.    Several functions return information about processes.
  747. `list-processes' is provided for interactive use.
  748.  - Command: list-processes
  749.      This command displays a listing of all living processes.  In
  750.      addition, it finally deletes any process whose status was `Exited'
  751.      or `Signaled'.  It returns `nil'.
  752.  - Function: process-list
  753.      This function returns a list of all processes that have not been
  754.      deleted.
  755.           (process-list)
  756.                => (#<process display-time> #<process shell>)
  757.  - Function: get-process NAME
  758.      This function returns the process named NAME, or `nil' if there is
  759.      none.  An error is signaled if NAME is not a string.
  760.           (get-process "shell")
  761.                => #<process shell>
  762.  - Function: process-command PROCESS
  763.      This function returns the command that was executed to start
  764.      PROCESS.  This is a list of strings, the first string being the
  765.      program executed and the rest of the strings being the arguments
  766.      that were given to the program.
  767.           (process-command (get-process "shell"))
  768.                => ("/bin/csh" "-i")
  769.  - Function: process-id PROCESS
  770.      This function returns the PID of PROCESS.  This is an integer that
  771.      distinguishes the process PROCESS from all other processes running
  772.      on the same computer at the current time.  The PID of a process is
  773.      chosen by the operating system kernel when the process is started
  774.      and remains constant as long as the process exists.
  775.  - Function: process-name PROCESS
  776.      This function returns the name of PROCESS.
  777.  - Function: process-status PROCESS-NAME
  778.      This function returns the status of PROCESS-NAME as a symbol.  The
  779.      argument PROCESS-NAME must be a process, a buffer, a process name
  780.      (string) or a buffer name (string).
  781.      The possible values for an actual subprocess are:
  782.     `run'
  783.           for a process that is running.
  784.     `stop'
  785.           for a process that is stopped but continuable.
  786.     `exit'
  787.           for a process that has exited.
  788.     `signal'
  789.           for a process that has received a fatal signal.
  790.     `open'
  791.           for a network connection that is open.
  792.     `closed'
  793.           for a network connection that is closed.  Once a connection
  794.           is closed, you cannot reopen it, though you might be able to
  795.           open a new connection to the same place.
  796.     `nil'
  797.           if PROCESS-NAME is not the name of an existing process.
  798.           (process-status "shell")
  799.                => run
  800.           (process-status (get-buffer "*shell*"))
  801.                => run
  802.           x
  803.                => #<process xx<1>>
  804.           (process-status x)
  805.                => exit
  806.      For a network connection, `process-status' returns one of the
  807.      symbols `open' or `closed'.  The latter means that the other side
  808.      closed the connection, or Emacs did `delete-process'.
  809.      In earlier Emacs versions (prior to version 19), the status of a
  810.      network connection was `run' if open, and `exit' if closed.
  811.  - Function: process-exit-status PROCESS
  812.      This function returns the exit status of PROCESS or the signal
  813.      number that killed it.  (Use the result of `process-status' to
  814.      determine which of those it is.)  If PROCESS has not yet
  815.      terminated, the value is 0.
  816.  - Function: process-tty-name PROCESS
  817.      This function returns the terminal name that PROCESS is using for
  818.      its communication with Emacs--or `nil' if it is using pipes
  819.      instead of a terminal (see `process-connection-type' in *Note
  820.      Asynchronous Processes::).
  821. File: elisp,  Node: Input to Processes,  Next: Signals to Processes,  Prev: Process Information,  Up: Processes
  822. Sending Input to Processes
  823. ==========================
  824.    Asynchronous subprocesses receive input when it is sent to them by
  825. Emacs, which is done with the functions in this section.  You must
  826. specify the process to send input to, and the input data to send.  The
  827. data appears on the "standard input" of the subprocess.
  828.    Some operating systems have limited space for buffered input in a
  829. PTY.  On these systems, Emacs sends an EOF periodically amidst the
  830. other characters, to force them through.  For most programs, these EOFs
  831. do no harm.
  832.  - Function: process-send-string PROCESS-NAME STRING
  833.      This function sends PROCESS-NAME the contents of STRING as
  834.      standard input.  The argument PROCESS-NAME must be a process or
  835.      the name of a process.  If it is `nil', the current buffer's
  836.      process is used.
  837.      The function returns `nil'.
  838.           (process-send-string "shell<1>" "ls\n")
  839.                => nil
  840.           ---------- Buffer: *shell* ----------
  841.           ...
  842.           introduction.texi               syntax-tables.texi~
  843.           introduction.texi~              text.texi
  844.           introduction.txt                text.texi~
  845.           ...
  846.           ---------- Buffer: *shell* ----------
  847.  - Command: process-send-region PROCESS-NAME START END
  848.      This function sends the text in the region defined by START and
  849.      END as standard input to PROCESS-NAME, which is a process or a
  850.      process name.  (If it is `nil', the current buffer's process is
  851.      used.)
  852.      An error is signaled unless both START and END are integers or
  853.      markers that indicate positions in the current buffer.  (It is
  854.      unimportant which number is larger.)
  855.  - Function: process-send-eof &optional PROCESS-NAME
  856.      This function makes PROCESS-NAME see an end-of-file in its input.
  857.      The EOF comes after any text already sent to it.
  858.      If PROCESS-NAME is not supplied, or if it is `nil', then this
  859.      function sends the EOF to the current buffer's process.  An error
  860.      is signaled if the current buffer has no process.
  861.      The function returns PROCESS-NAME.
  862.           (process-send-eof "shell")
  863.                => "shell"
  864. File: elisp,  Node: Signals to Processes,  Next: Output from Processes,  Prev: Input to Processes,  Up: Processes
  865. Sending Signals to Processes
  866. ============================
  867.    "Sending a signal" to a subprocess is a way of interrupting its
  868. activities.  There are several different signals, each with its own
  869. meaning.  The set of signals and their names is defined by the operating
  870. system.  For example, the signal `SIGINT' means that the user has typed
  871. `C-c', or that some analogous thing has happened.
  872.    Each signal has a standard effect on the subprocess.  Most signals
  873. kill the subprocess, but some stop or resume execution instead.  Most
  874. signals can optionally be handled by programs; if the program handles
  875. the signal, then we can say nothing in general about its effects.
  876.    You can send signals explicitly by calling the functions in this
  877. section.  Emacs also sends signals automatically at certain times:
  878. killing a buffer sends a `SIGHUP' signal to all its associated
  879. processes; killing Emacs sends a `SIGHUP' signal to all remaining
  880. processes.  (`SIGHUP' is a signal that usually indicates that the user
  881. hung up the phone.)
  882.    Each of the signal-sending functions takes two optional arguments:
  883. PROCESS-NAME and CURRENT-GROUP.
  884.    The argument PROCESS-NAME must be either a process, the name of one,
  885. or `nil'.  If it is `nil', the process defaults to the process
  886. associated with the current buffer.  An error is signaled if
  887. PROCESS-NAME does not identify a process.
  888.    The argument CURRENT-GROUP is a flag that makes a difference when
  889. you are running a job-control shell as an Emacs subprocess.  If it is
  890. non-`nil', then the signal is sent to the current process-group of the
  891. terminal that Emacs uses to communicate with the subprocess.  If the
  892. process is a job-control shell, this means the shell's current subjob.
  893. If it is `nil', the signal is sent to the process group of the
  894. immediate subprocess of Emacs.  If the subprocess is a job-control
  895. shell, this is the shell itself.
  896.    The flag CURRENT-GROUP has no effect when a pipe is used to
  897. communicate with the subprocess, because the operating system does not
  898. support the distinction in the case of pipes.  For the same reason,
  899. job-control shells won't work when a pipe is used.  See
  900. `process-connection-type' in *Note Asynchronous Processes::.
  901.  - Function: interrupt-process &optional PROCESS-NAME CURRENT-GROUP
  902.      This function interrupts the process PROCESS-NAME by sending the
  903.      signal `SIGINT'.  Outside of Emacs, typing the "interrupt
  904.      character" (normally `C-c' on some systems, and `DEL' on others)
  905.      sends this signal.  When the argument CURRENT-GROUP is non-`nil',
  906.      you can think of this function as "typing `C-c'" on the terminal
  907.      by which Emacs talks to the subprocess.
  908.  - Function: kill-process &optional PROCESS-NAME CURRENT-GROUP
  909.      This function kills the process PROCESS-NAME by sending the signal
  910.      `SIGKILL'.  This signal kills the subprocess immediately, and
  911.      cannot be handled by the subprocess.
  912.  - Function: quit-process &optional PROCESS-NAME CURRENT-GROUP
  913.      This function sends the signal `SIGQUIT' to the process
  914.      PROCESS-NAME.  This signal is the one sent by the "quit character"
  915.      (usually `C-b' or `C-\') when you are not inside Emacs.
  916.  - Function: stop-process &optional PROCESS-NAME CURRENT-GROUP
  917.      This function stops the process PROCESS-NAME by sending the signal
  918.      `SIGTSTP'.  Use `continue-process' to resume its execution.
  919.      On systems with job control, the "stop character" (usually `C-z')
  920.      sends this signal (outside of Emacs).  When CURRENT-GROUP is
  921.      non-`nil', you can think of this function as "typing `C-z'" on the
  922.      terminal Emacs uses to communicate with the subprocess.
  923.  - Function: continue-process &optional PROCESS-NAME CURRENT-GROUP
  924.      This function resumes execution of the process PROCESS by sending
  925.      it the signal `SIGCONT'.  This presumes that PROCESS-NAME was
  926.      stopped previously.
  927.  - Function: signal-process PID SIGNAL
  928.      This function sends a signal to process PID, which need not be a
  929.      child of Emacs.  The argument SIGNAL specifies which signal to
  930.      send; it should be an integer.
  931.